#!/bin/bash

set -e

. script/bootstrap

mkdir -p bin
bindir="$PWD"/bin
scriptdir="$PWD"/script

# We have a few binaries that we want to build, so let's put them into bin/

version=$(git rev-parse HEAD)
describe=$(git describe --tags --always --dirty)

trimpath=$(cd $GOPATH/src ; pwd)
export GOPATH="$PWD/.gopath"
cd .gopath/src/github.com/outbrain/zookeepercli

# We put the binaries directly into the bindir, because we have no need for shim wrappers
go build -gcflags="-trimpath=${trimpath}" -asmflags="-trimpath=${trimpath}" -o "$bindir/zookeepercli" ./go/cmd/zookeepercli.go
